﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TransCend.Model
{
    /// <summary>
    /// 指示数据表的某一列是否是主键列
    /// </summary>
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = false)]
    [Serializable]
    public class PrimaryKeyAttribute : Attribute
    {
        private bool _identity;

        /// <summary>
        /// 指示主键列是否是自增长列
        /// </summary>
        public bool Identity { get { return _identity; } }

        public PrimaryKeyAttribute() : this(true) { }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="identity">是否自增长</param>
        public PrimaryKeyAttribute(bool identity) { _identity = identity; }
    }
}
